#include<bits/stdc++.h>
using namespace std;
#define all(x) (x).begin(),(x).end()
#define rall(x) (x).rbegin(),(x).rend()
const int N=2e5+10;
#define INF 0x3f3f3f3f;
typedef long long int ll;
#define close(); std::ios::sync_with_stdio(false);cin.tie(0),cout.tie(0);
//----------------------------------------------------------------------------//

ll n,sum2;
int main()
{
	close();
	cin>>n;
	while(n>=3)
	{
		if(n%2==0) 
		{
			n=n/2+1;sum2++;
		}
		else 
		{
			n=(n+1)/2;sum2++;
		}
	}
	cout<<sum2;
}
